<template>
	<view class="share_container" v-if="showShare" @click="changeShow">
		<image src="https://oss-shop.cciinet.com/files/MiniProgram/share_wx.png" mode="widthFix"></image>
	</view>
</template>

<script>
	export default {
		props: {
			showShare: {
				type: Boolean,
				default: false
			},
		},
		mounted() {
			this.setShareOpt()
		},
		methods: {
			setShareOpt(obj) {
				if (this.$wechat && this.$wechat.isWechat()) {
					this.$wechat.share({
						title: obj&&obj.title,
						desc: obj&&obj.desc,
						img: obj&&obj.img
					});
				}
			},
			changeShow() {
				this.$emit('changeShow', false)
			},
		}
	}
</script>

<style lang="scss" scoped>
	.share_container {
		height: 100%;
		width: 100%;
		position: fixed;
		top: 0;
		left: 0;
		background: rgba(0, 0, 0, 0.75);
		z-index: 999999;

		image {
			position: absolute;
			width: 50%;
			top: 20upx;
			right: 100upx;
		}
	}
</style>
